home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib03.dsk
/
LE MANS (APPLESOFT).bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
5KB
|
114 lines
1 REM **********************
2 REM * LE MANS *
3 REM * BY CHARLES G BOODY *
4 REM * COPYRIGHT (C) 1981 *
5 REM * BY MICROSPARC, INC *
6 REM * LINCOLN, MA 01773 *
7 REM **********************
8 REM
9 REM CONVERTED FROM INTEGER BASIC TO APPLESOFT BASIC BY SAMUEL STODDARD, 2008.
10 HIMEM: 38144: GOSUB 955
15 P = P +1: POKE 38127 -P,204: POKE 38141 -P,204: IF P <23 THEN RETURN
17 POP : GOTO 185
20 R = INT( RND(1) *(2 *R1 +1) -R1):TI = INT( RND(1) *11 +4)
25 FOR A = 1 TO TI:T = T +R: IF T <1 THEN T = 1
27 IF T >P THEN T = P
30 IF T = 1 OR T = P THEN R = R * -1
32 IF M/100 = INT(M/100) THEN GOSUB 15
35 M = M +1: HTAB T: VTAB 19: PRINT A$: CALL -912:X = INT( PDL(0)/7) +1
40 Y = INT( PDL(1)/7) +1: IF SCRN( Y -1,8) = 10 THEN 45
42 YY = YY -1: VTAB 24: HTAB 23: PRINT YY;" ";
45 IF SCRN( X -1,8) = 11 THEN 50
47 VTAB 24: HTAB 7:Z = Z -1: PRINT Z;" ";
50 VTAB 4: HTAB X: PRINT C$;: HTAB Y: PRINT X$: NEXT : GOTO 20
55 HOME
65 GR : POKE 34,0
70 GOSUB 910
75 Z = 500:YY = 500
80 VTAB 24
85 C$ = "*"
90 X$ = ";"
95 T = 1
100 FOR A = 1 TO 20: HTAB T: PRINT A$;: NEXT
105 VTAB 24: HTAB 1
110 PRINT "POSITION THE GREY CAR ON THE LEFT TRACK AND THE OTHER CAR ON THE RIGHT TRACK."
115 PRINT "PUSH BUTTON ON GREY CAR PADDLE TO START.";
125 HTAB 1: VTAB 4
130 IF PEEK( -16287) >127 THEN 155
135 PRINT LEFT$(A$,40);: VTAB 4
140 HTAB ( PDL(0)/7) +1: PRINT C$;
145 HTAB ( PDL(1)/7) +1: PRINT X$;: HTAB 1
150 GOTO 130
155 VTAB 21: CALL -958
160 POKE 35,22: VTAB 24: HTAB 2: PRINT "GREY ";Z;: HTAB 18: PRINT "BLUE ";YY;
165 GOTO 25
185 COLOR= 0: HLIN 0,39 AT 8: HLIN 0,39 AT 9
190 COLOR= 15: FOR I = 1 TO 30: HLIN 0,39 AT 9 +I: NEXT
195 POKE 35,24: POKE 34,20
200 HTAB 7: VTAB 21: IF Z >YY THEN PRINT "GREY CAR WINS!!!!!": GOTO 205
202 IF YY >Z THEN PRINT "BLUE CAR WINS!!!!!"
205 HTAB 4: PRINT "DO YOU WANT ANOTHER RACE (Y/N)?": INPUT Z$: IF Z$ < >"Y" THEN 2000
207 CALL -958
210 HTAB 4: PRINT "THE SAME SET-UP? (Y/N)?": INPUT Z$: IF Z$ < >"Y" THEN 1050
212 P = 15:M = 1: GOTO 55
305 P = P +1: POKE 38127 -P,204: POKE 38141 -P,204: IF P <23 THEN RETURN
307 POP : GOTO 480
310 R = INT( RND(1) *(2 *R1 +1) -R1):TI = INT( RND(1) *11 +4)
315 FOR A = 1 TO TI:T = T +R: IF T <1 THEN T = 1
317 IF T >P THEN T = P
320 IF T = 1 OR T = P THEN R = R * -1
322 IF M/100 = INT(M/100) THEN GOSUB 305
325 M = M +1: HTAB T: VTAB 24: PRINT A$;: VTAB 10:X = INT( PDL(0)/7) +1
330 Y = INT( PDL(1)/7) +1: IF SCRN( Y -1,20) < >10 THEN PRINT B$;
332 IF SCRN( Y -1,20) < >10 THEN YY = YY +1
335 IF SCRN( X -1,20) < >11 THEN PRINT B$;
337 IF SCRN( X -1,20) < >11 THEN Z = Z +1
340 HTAB X: PRINT C$;: HTAB Y: PRINT X$: NEXT : GOTO 310
355 HOME
360 GR : POKE 34,0
365 GOSUB 910
370 Z = 0:YY = 0
375 VTAB 24
380 C$ = "*"
385 X$ = ";"
390 T = 1:C = 20
395 FOR A = 1 TO 14: HTAB T: PRINT A$;: NEXT
400 VTAB 24: HTAB 1
405 PRINT "POSITION THE GREY CAR ON THE LEFT TRACK AND THE OTHER CAR ON THE RIGHT TRACK."
410 PRINT "PUSH BUTTON ON GREY CAR PADDLE TO START.";
420 HTAB 1: VTAB 10
425 IF PEEK( -16287) >127 THEN 450
430 PRINT LEFT$(A$,40);: VTAB 9
435 HTAB ( PDL(0)/7) +1: PRINT C$;
440 HTAB ( PDL(1)/7) +1: PRINT X$;: HTAB 1
445 GOTO 425
450 POKE -16302,0: VTAB 21: FOR A = 1 TO 4: PRINT A$;: NEXT
455 GOTO 315
480 TEXT : HOME
482 PRINT " GREY CAR SCORE: ";500 -Z;: PRINT " BLUE CAR SCORE: ";500 -YY;
485 HTAB 7: IF Z <YY THEN PRINT "GREY CAR WINS!!!!!": GOTO 490
487 IF YY <Z THEN PRINT "BLUE CAR WINS!!!!!"
490 PRINT : PRINT : HTAB 4: PRINT "DO YOU WANT ANOTHER RACE? (Y/N)?": INPUT Z$: IF Z$ < >"Y" THEN 2000
494 CALL -958
495 PRINT "THE SAME SET-UP? (Y/N)?": INPUT Z$: IF Z$ < >"Y" THEN 1050
497 P = 15:M = 0: GOTO 355
900 A$ = "" +";;;;;;;;;;;LLL***********LLLLLLLLLLLLLLLLLL": REM STRING CONCATENATION FORCES A$ AT HIMEM
905 RETURN
910 FOR I = 38101 TO 38111: POKE I,59: NEXT
915 FOR I = 38115 TO 38125: POKE I,42: NEXT
920 RETURN
955 REM INITIALIZATION
957 GOSUB 900
960 P = 15:R = 0:T = 0:A = 0: DIM C$(1),X$(1):M = 1:B$ = CHR$(7)
965 POKE 250,160
1000 TEXT : CALL -936: PRINT "WELCOME TO GRAND PRIX, A COMPETITIVE ROAD RACE GAME FOR TWO PLAYERS.": PRINT
1005 PRINT "THREE LEVELS OF TRACK DIFFICULTY ARE AVAILABLE. CHOOSE YOURS BY NUMBER AND HIT RETURN:"
1010 HTAB 5: PRINT "1. FREEWAY DRIVER": HTAB 5: PRINT "2. AMATEUR RACE DRIVER": HTAB 5: PRINT "3. GRAND PRIX DRIVER"
1015 PRINT : HTAB 10: INPUT "WHICH? ";R1
1025 PRINT : PRINT "HOW DO YOU WANT A CAR OFF THE ROAD INDICATED?": HTAB 5: PRINT "1. DECREASING SCORE (STEADY SPEED)"
1030 HTAB 5: PRINT "2. BELL & DECREASING SCORE (SLOWS GAME)"
1035 PRINT : HTAB 10: INPUT "WHICH? ";R
1040 IF R = 1 THEN GOTO 55
1045 GOTO 355
1050 TEXT : HOME :P = 15:M = 1: GOTO 1005
2000 TEXT : HOME : END